package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosFlowMatchMapper;
import com.ruoyi.net.domain.ElementQosFlowMatch;
import com.ruoyi.net.service.IElementQosFlowMatchService;

/**
 * 网元-QOS配置-流分类-匹配规则Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosFlowMatchServiceImpl implements IElementQosFlowMatchService 
{
    @Autowired
    private ElementQosFlowMatchMapper elementQosFlowMatchMapper;

    /**
     * 查询网元-QOS配置-流分类-匹配规则
     * 
     * @param id 网元-QOS配置-流分类-匹配规则主键
     * @return 网元-QOS配置-流分类-匹配规则
     */
    @Override
    public ElementQosFlowMatch selectElementQosFlowMatchById(String id)
    {
        return elementQosFlowMatchMapper.selectElementQosFlowMatchById(id);
    }

    /**
     * 查询网元-QOS配置-流分类-匹配规则列表
     * 
     * @param elementQosFlowMatch 网元-QOS配置-流分类-匹配规则
     * @return 网元-QOS配置-流分类-匹配规则
     */
    @Override
    public List<ElementQosFlowMatch> selectElementQosFlowMatchList(ElementQosFlowMatch elementQosFlowMatch)
    {
        return elementQosFlowMatchMapper.selectElementQosFlowMatchList(elementQosFlowMatch);
    }

    /**
     * 新增网元-QOS配置-流分类-匹配规则
     * 
     * @param elementQosFlowMatch 网元-QOS配置-流分类-匹配规则
     * @return 结果
     */
    @Override
    public int insertElementQosFlowMatch(ElementQosFlowMatch elementQosFlowMatch)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosFlowMatch.getId())) {
            elementQosFlowMatch.setId(uuid);
        }
        elementQosFlowMatch.setCreateBy(SecurityUtils.getUsername());
        elementQosFlowMatch.setCreateTime(DateUtils.getNowDate());
        elementQosFlowMatch.setUpdateBy(SecurityUtils.getUsername());
        elementQosFlowMatch.setUpdateTime(DateUtils.getNowDate());
        return elementQosFlowMatchMapper.insertElementQosFlowMatch(elementQosFlowMatch);
    }

    /**
     * 修改网元-QOS配置-流分类-匹配规则
     * 
     * @param elementQosFlowMatch 网元-QOS配置-流分类-匹配规则
     * @return 结果
     */
    @Override
    public int updateElementQosFlowMatch(ElementQosFlowMatch elementQosFlowMatch)
    {
        elementQosFlowMatch.setUpdateBy(SecurityUtils.getUsername());
        elementQosFlowMatch.setUpdateTime(DateUtils.getNowDate());
        return elementQosFlowMatchMapper.updateElementQosFlowMatch(elementQosFlowMatch);
    }

    /**
     * 批量删除网元-QOS配置-流分类-匹配规则
     * 
     * @param ids 需要删除的网元-QOS配置-流分类-匹配规则主键
     * @return 结果
     */
    @Override
    public int deleteElementQosFlowMatchByIds(String[] ids)
    {
        return elementQosFlowMatchMapper.deleteElementQosFlowMatchByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流分类-匹配规则信息
     * 
     * @param id 网元-QOS配置-流分类-匹配规则主键
     * @return 结果
     */
    @Override
    public int deleteElementQosFlowMatchById(String id)
    {
        return elementQosFlowMatchMapper.deleteElementQosFlowMatchById(id);
    }
}
